<%--
  Created by IntelliJ IDEA.
  User: 13585
  Date: 2020/12/23
  Time: 8:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="top.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>预约信息列表</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/index.css" rel="stylesheet">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="js/jquery-3.2.1.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="js/bootstrap.min.js"></script>
</head>
<body>

<div id="list">
    <div class="title">会议室信息</div>
    <div class="content">
        <table class="table table-bordered table-hover">
            <tr class="info">
                <th>编号</th>
                <th>状态</th>
                <th>主题</th>
                <th>会议室</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>备注</th>
            </tr>

            <c:forEach items="${listPage.list}" var="applyList" varStatus="vs">
                <tr>
                    <td>${vs.count}</td>
                    <td><span class="${applyList.style}">${applyList.status}</span></td>
                    <td><a href="${pageContext.request.contextPath}/info?id=${applyList.apply.id}">${applyList.apply.title}</a></td>
                    <td>${applyList.name}</td>
                    <td>${applyList.apply.starttime}</td>
                    <td>${applyList.apply.endtime}</td>
                    <td></td>
                </tr>
            </c:forEach>
        </table>
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <c:if test="${listPage.currentPage <= 1}">
                    <li class="disabled"><a href="applyList?currentPage=${listPage.currentPage}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a></li>
                </c:if>
                <c:if test="${listPage.currentPage > 1}">
                    <li><a href="applyList?currentPage=${listPage.currentPage - 1}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a></li>
                </c:if>
                <c:forEach begin="1" end="${listPage.totalPage}" varStatus="vs">
                    <c:if test="${vs.count == listPage.currentPage}">
                        <li class="active"><a href="applyList?currentPage=${vs.count}">${vs.count}</a></li>
                    </c:if>
                    <c:if test="${vs.count != listPage.currentPage}">
                        <li><a href="applyList?currentPage=${vs.count}">${vs.count}</a></li>
                    </c:if>
                </c:forEach>
                <c:if test="${listPage.currentPage >= listPage.totalPage}">
                    <li class="disabled"><a href="applyList?currentPage=${listPage.totalPage}" aria-label="Previous">
                        <span aria-hidden="true">&raquo;</span>
                    </a></li>
                </c:if>
                <c:if test="${listPage.currentPage < listPage.totalPage}">
                    <li><a href="applyList?currentPage=${listPage.currentPage + 1}" aria-label="Previous">
                        <span aria-hidden="true">&raquo;</span>
                    </a></li>
                </c:if>
            </ul>
        </nav>
    </div>
</div>

</body>
</html>
